package com.briup.recognition.web.controller;


import com.briup.recognition.bean.BaseUser;
import com.briup.recognition.bean.CallLog;
import com.briup.recognition.service.ICallLogService;
import com.briup.recognition.utils.Message;
import com.briup.recognition.utils.MessageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: kun
 * @Description:
 * @DateTime: 2021/3/28$ 23:39$
 * @Params: $
 * @Return $
 */
@RestController
@RequestMapping("/callLog")
public class CallLogController {
    @Autowired
    private ICallLogService callLogService;

    @GetMapping("query")
    public Message query(){
        List<CallLog> list = callLogService.query();
        return MessageUtil.success(list);
    }

    @PostMapping("saveOrUpdate")
    public Message saveOrUpdate(CallLog callLog){
        callLogService.saveOrUpdate(callLog);
        return  MessageUtil.success("操作成功！");
    }

    @DeleteMapping("deleteById")
    public Message deleteById(long id){
        callLogService.deleteById(id);
        return  MessageUtil.success("删除成功");
    }

}